import 'package:chatgreat/repo/api/creative.dart';
import 'package:chatgreat/repo/api/page.dart';
import 'package:chatgreat/repo/api_server.dart';
import 'package:bloc/bloc.dart';
import 'package:meta/meta.dart';

part 'gallery_event.dart';
part 'gallery_state.dart';

class GalleryBloc extends Bloc<GalleryEvent, GalleryState> {
  GalleryBloc() : super(GalleryInitial()) {

    on<GalleryItemLoadEvent>((event, emit) async {
      emit(GalleryInitial());

      await Future.delayed(const Duration(milliseconds: 700));

      emit(GalleryItemLoaded(
        item: event.creativeGallery,
      ));
    });
  }
}
